package com.hbnu.iostream;

import java.io.IOException;

public class PipedStreamDemo {
    public static void main(String[] args) {
        Send send = new Send();
        Receive receive = new Receive();

        try {
            send.pipedOutputStream.connect(receive.pipedInputStream);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

        new Thread(send).start();       //开启线程
        new Thread(receive).start();

    }
}
